﻿
window.onerror=noError;

function fixahref(){$("a").each(function(index){$(this).attr("target","_self");});} 

function noError(){return true;} 

function myInjectMac(){
	$("#visitorMac").val("B8-97-5A-31-4A-5D");
	var client=new Object();
	client["macs"]="B8-97-5A-31-4A-5D";
	client["cpuId"]="123fds"; 
	$.cookie('mac', JSON.stringify(client), {path: '/'});
}

function mengsk_search_ppcod(ppcod) {
    var urlRequest = "/ord/ordquery/findClientCanvassByPage.action?mainAction=mainOrderList_findClientCanvassByPage&orderChannelCode=PAIPAICOD_STD&pageSize=400&pageIndex=0&conditionOption=orderLogisticsCode&orderTypeCode=&assignOrgCode=&logistics=&timeout=&include=&orgCode=&orgName=&sortName=&sortType=&isProcess=&checkSearchSafeCode=&senderProvName=&startDate=&endDate=&rand=0.24757146171899602&conditionText=" + ppcod;
    return mengsk_search(urlRequest);
}

function mengsk_search_phone(phone) {
    var urlRequest = "/ord/ordquery/findClientCanvassByPage.action?mainAction=mainOrderList_findClientCanvassByPage&orderChannelCode=PAIPAICOD_STD&pageSize=400&pageIndex=0&conditionOption=senderPhone&orderTypeCode=&assignOrgCode=&logistics=&timeout=&include=&orgCode=&orgName=&sortName=&sortType=&isProcess=&checkSearchSafeCode=&senderProvName=&startDate=&endDate=&rand=0.24757146171899602&conditionText=" + phone;
    return mengsk_search(urlRequest);
}

function mengsk_search_mobile(mobile) {
    var urlRequest = "/ord/ordquery/findClientCanvassByPage.action?mainAction=mainOrderList_findClientCanvassByPage&orderChannelCode=PAIPAICOD_STD&pageSize=400&pageIndex=0&conditionOption=senderMobile&orderTypeCode=&assignOrgCode=&logistics=&timeout=&include=&orgCode=&orgName=&sortName=&sortType=&isProcess=&checkSearchSafeCode=&senderProvName=&startDate=&endDate=&rand=0.24757146171899602&conditionText=" + mobile;
    return mengsk_search(urlRequest);
}

function mengsk_search(urlRequest) {
    var requestOk = false;
    var htmlData = "FALSE";
    $.ajax({ url: urlRequest, async: false, success: function (hData) { requestOk = true; htmlData = hData; } });
    return htmlData;
}

function mengsk_markdelivery(oid, deliverynumber) {
    var selectedOrders = new Array();
    selectedOrders.push({ orderId: oid, inputWaybillNo: deliverynumber, feedback: "" });
    var data = "FALSE";
    $.ajax({
        type: "POST",
        url: "/ord/ordoper/canvassOrders.action",
        async: false,
        data: {
            orderIdsJson: JSON.stringify(selectedOrders),
            orderOperType: "6",
            failureCode: "",
            orderChannelCode: 'PAIPAICOD_STD'
        },
        success: function (result) {
            try {
                var obj = $.parseJSON(result);
                data = obj.result;
            } catch (e) {
                data = result;
            }
        },
        error: function (err) {
            data = err;
        }
    });

    return data;
}
